package com.pbking.facebook.delegates.data
{
	import com.pbking.facebook.Facebook;
	import com.pbking.facebook.delegates.FacebookDelegate;

	public class GetUserPreferenceDelegate extends FacebookDelegate
	{
		public var preferenceValue:String;
		
		public function GetUserPreferenceDelegate(facebook:Facebook, pref_id:int)
		{
			super(facebook);
			fbCall.setRequestArgument("pref_id", pref_id);
			fbCall.post("facebook.data.getUserPreference");
		}
		
		override protected function handleResult(result:Object):void
		{
			// if it fails, preferenceValue is set to blank string
			preferenceValue = "";
			if (result) {
				preferenceValue = result as String;
			}
		}
		
	}
}